using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.Serialization;
using System.Web.Script.Serialization;
using System.Xml.Serialization;
using XCode;
using XCode.Configuration;
using XCode.DataAccessLayer;

namespace BluetoothMachine.Entity
{
    /// <summary>机构对点</summary>
    [Serializable]
    [DataObject]
    [Description("机构对点")]
    [BindTable("ProductionPoint", Description = "机构对点", ConnName = "MySql", DbType = DatabaseType.None)]
    public partial class ProductionPoint
    {
        #region 属性
        private Int32 _ID;
        /// <summary>编号</summary>
        [DisplayName("编号")]
        [Description("编号")]
        [DataObjectField(true, true, false, 0)]
        [BindColumn("ID", "编号", "")]
        public Int32 ID { get => _ID; set { if (OnPropertyChanging("ID", value)) { _ID = value; OnPropertyChanged("ID"); } } }

        private String _KeyName;
        /// <summary>按键名</summary>
        [DisplayName("按键名")]
        [Description("按键名")]
        [DataObjectField(false, false, true, 128)]
        [BindColumn("KeyName", "按键名", "varchar(128)")]
        public String KeyName { get => _KeyName; set { if (OnPropertyChanging("KeyName", value)) { _KeyName = value; OnPropertyChanged("KeyName"); } } }

        private Int32 _Index;
        /// <summary>排序用</summary>
        [DisplayName("排序用")]
        [Description("排序用")]
        [DataObjectField(false, false, false, 0)]
        [BindColumn("Index", "排序用", "")]
        public Int32 Index { get => _Index; set { if (OnPropertyChanging("Index", value)) { _Index = value; OnPropertyChanged("Index"); } } }

        private Int32 _Aisle;
        /// <summary>通道</summary>
        [DisplayName("通道")]
        [Description("通道")]
        [DataObjectField(false, false, false, 0)]
        [BindColumn("Aisle", "通道", "")]
        public Int32 Aisle { get => _Aisle; set { if (OnPropertyChanging("Aisle", value)) { _Aisle = value; OnPropertyChanged("Aisle"); } } }

        private String _FuncType;
        /// <summary>任务名</summary>
        [DisplayName("任务名")]
        [Description("任务名")]
        [DataObjectField(false, false, true, 50)]
        [BindColumn("FuncType", "任务名", "varchar(50)")]
        public String FuncType { get => _FuncType; set { if (OnPropertyChanging("FuncType", value)) { _FuncType = value; OnPropertyChanged("FuncType"); } } }

        private String _ProductModel;
        /// <summary>产品型号</summary>
        [DisplayName("产品型号")]
        [Description("产品型号")]
        [DataObjectField(false, false, true, 50)]
        [BindColumn("ProductModel", "产品型号", "varchar(50)")]
        public String ProductModel { get => _ProductModel; set { if (OnPropertyChanging("ProductModel", value)) { _ProductModel = value; OnPropertyChanged("ProductModel"); } } }

        private String _InfraredData;
        /// <summary>红外数据</summary>
        [DisplayName("红外数据")]
        [Description("红外数据")]
        [DataObjectField(false, false, true, 512)]
        [BindColumn("InfraredData", "红外数据", "varchar(512)")]
        public String InfraredData { get => _InfraredData; set { if (OnPropertyChanging("InfraredData", value)) { _InfraredData = value; OnPropertyChanged("InfraredData"); } } }

        private Double _Ppx;
        /// <summary>X轴坐标</summary>
        [DisplayName("X轴坐标")]
        [Description("X轴坐标")]
        [DataObjectField(false, false, false, 0)]
        [BindColumn("Ppx", "X轴坐标", "double")]
        public Double Ppx { get => _Ppx; set { if (OnPropertyChanging("Ppx", value)) { _Ppx = value; OnPropertyChanged("Ppx"); } } }

        private Double _Ppy;
        /// <summary>Y轴坐标</summary>
        [DisplayName("Y轴坐标")]
        [Description("Y轴坐标")]
        [DataObjectField(false, false, false, 0)]
        [BindColumn("Ppy", "Y轴坐标", "double")]
        public Double Ppy { get => _Ppy; set { if (OnPropertyChanging("Ppy", value)) { _Ppy = value; OnPropertyChanged("Ppy"); } } }

        private Double _Ppz;
        /// <summary>Z轴坐标</summary>
        [DisplayName("Z轴坐标")]
        [Description("Z轴坐标")]
        [DataObjectField(false, false, false, 0)]
        [BindColumn("Ppz", "Z轴坐标", "double")]
        public Double Ppz { get => _Ppz; set { if (OnPropertyChanging("Ppz", value)) { _Ppz = value; OnPropertyChanged("Ppz"); } } }

        private Boolean _IsEnable;
        /// <summary>是否启用</summary>
        [DisplayName("是否启用")]
        [Description("是否启用")]
        [DataObjectField(false, false, false, 0)]
        [BindColumn("IsEnable", "是否启用", "")]
        public Boolean IsEnable { get => _IsEnable; set { if (OnPropertyChanging("IsEnable", value)) { _IsEnable = value; OnPropertyChanged("IsEnable"); } } }
        #endregion

        #region 获取/设置 字段值
        /// <summary>获取/设置 字段值</summary>
        /// <param name="name">字段名</param>
        /// <returns></returns>
        public override Object this[String name]
        {
            get
            {
                switch (name)
                {
                    case "ID": return _ID;
                    case "KeyName": return _KeyName;
                    case "Index": return _Index;
                    case "Aisle": return _Aisle;
                    case "FuncType": return _FuncType;
                    case "ProductModel": return _ProductModel;
                    case "InfraredData": return _InfraredData;
                    case "Ppx": return _Ppx;
                    case "Ppy": return _Ppy;
                    case "Ppz": return _Ppz;
                    case "IsEnable": return _IsEnable;
                    default: return base[name];
                }
            }
            set
            {
                switch (name)
                {
                    case "ID": _ID = value.ToInt(); break;
                    case "KeyName": _KeyName = Convert.ToString(value); break;
                    case "Index": _Index = value.ToInt(); break;
                    case "Aisle": _Aisle = value.ToInt(); break;
                    case "FuncType": _FuncType = Convert.ToString(value); break;
                    case "ProductModel": _ProductModel = Convert.ToString(value); break;
                    case "InfraredData": _InfraredData = Convert.ToString(value); break;
                    case "Ppx": _Ppx = value.ToDouble(); break;
                    case "Ppy": _Ppy = value.ToDouble(); break;
                    case "Ppz": _Ppz = value.ToDouble(); break;
                    case "IsEnable": _IsEnable = value.ToBoolean(); break;
                    default: base[name] = value; break;
                }
            }
        }
        #endregion

        #region 字段名
        /// <summary>取得机构对点字段信息的快捷方式</summary>
        public partial class _
        {
            /// <summary>编号</summary>
            public static readonly Field ID = FindByName("ID");

            /// <summary>按键名</summary>
            public static readonly Field KeyName = FindByName("KeyName");

            /// <summary>排序用</summary>
            public static readonly Field Index = FindByName("Index");

            /// <summary>通道</summary>
            public static readonly Field Aisle = FindByName("Aisle");

            /// <summary>任务名</summary>
            public static readonly Field FuncType = FindByName("FuncType");

            /// <summary>产品型号</summary>
            public static readonly Field ProductModel = FindByName("ProductModel");

            /// <summary>红外数据</summary>
            public static readonly Field InfraredData = FindByName("InfraredData");

            /// <summary>X轴坐标</summary>
            public static readonly Field Ppx = FindByName("Ppx");

            /// <summary>Y轴坐标</summary>
            public static readonly Field Ppy = FindByName("Ppy");

            /// <summary>Z轴坐标</summary>
            public static readonly Field Ppz = FindByName("Ppz");

            /// <summary>是否启用</summary>
            public static readonly Field IsEnable = FindByName("IsEnable");

            static Field FindByName(String name) => Meta.Table.FindByName(name);
        }

        /// <summary>取得机构对点字段名称的快捷方式</summary>
        public partial class __
        {
            /// <summary>编号</summary>
            public const String ID = "ID";

            /// <summary>按键名</summary>
            public const String KeyName = "KeyName";

            /// <summary>排序用</summary>
            public const String Index = "Index";

            /// <summary>通道</summary>
            public const String Aisle = "Aisle";

            /// <summary>任务名</summary>
            public const String FuncType = "FuncType";

            /// <summary>产品型号</summary>
            public const String ProductModel = "ProductModel";

            /// <summary>红外数据</summary>
            public const String InfraredData = "InfraredData";

            /// <summary>X轴坐标</summary>
            public const String Ppx = "Ppx";

            /// <summary>Y轴坐标</summary>
            public const String Ppy = "Ppy";

            /// <summary>Z轴坐标</summary>
            public const String Ppz = "Ppz";

            /// <summary>是否启用</summary>
            public const String IsEnable = "IsEnable";
        }
        #endregion
    }
}